﻿package com.yy.ui.controls {
    import flash.display.*;
    import com.fminutes.vinciUI.general.*;
    import gs.*;
    import flash.text.*;

    public class LabelButton extends Button {

        private var _scaleLabel:DisplayObject;
        private var _label:Label;
        private var _scale:Boolean;
        private var _child:Sprite;
        private var _padding:int = 0;

        public function LabelButton(_arg1=null, _arg2:String="", _arg3:VinciFont=null, _arg4:Number=0, _arg5:Boolean=true){
            this._scale = _arg5;
            this._label = new Label(_arg2, _arg3, _arg4);
            if (_arg5){
                this._scaleLabel = new ScaleDisplayObject(this._label);
            } else {
                this._scaleLabel = this._label;
            };
            addChild(this._scaleLabel);
            super(_arg1);
        }
        override protected function set background(_arg1:DisplayObject):void{
            if (this._scale){
                super.background = new ScaleDisplayObject(_arg1);
            } else {
                super.background = _arg1;
            };
        }
        override public function set width(_arg1:Number):void{
            super.width = _arg1;
            this._scaleLabel.width = _arg1;
        }
        override public function set height(_arg1:Number):void{
            super.height = _arg1;
            this._scaleLabel.height = _arg1;
        }
        override public function set enable(_arg1:Boolean):void{
            this.mouseOut();
            super.enable = _arg1;
        }
        override protected function mouseOver():void{
            if (((enable) && (this._scale))){
                TweenLite.to(this.background, 0.4, {
                    scaleX:1.2,
                    scaleY:1.2
                });
                TweenLite.to(this._scaleLabel, 0.4, {
                    scaleX:1.2,
                    scaleY:1.2
                });
            };
        }
        override protected function mouseOut():void{
            if (((enable) && (this._scale))){
                TweenLite.to(this.background, 0.4, {
                    scaleX:1,
                    scaleY:1
                });
                TweenLite.to(this._scaleLabel, 0.4, {
                    scaleX:1,
                    scaleY:1
                });
            };
        }
        override protected function mouseDown():void{
        }
        override protected function mouseUp():void{
        }
        public function get text():String{
            return (this._label.text);
        }
        public function set text(_arg1:String):void{
            this._label.text = _arg1;
            if (this._label.widthAuto){
                this.width = (this._label.width + (this.padding * 2));
            };
        }
        public function get widthAuto():Boolean{
            return (this._label.widthAuto);
        }
        public function set widthAuto(_arg1:Boolean):void{
            this._label.widthAuto = _arg1;
            if (_arg1){
                this.width = (this._label.width + (this.padding * 2));
            };
        }
        public function get padding():int{
            return (this._padding);
        }
        public function set padding(_arg1:int):void{
            this._padding = _arg1;
            this.widthAuto = this.widthAuto;
        }
        public function get textColor():uint{
            return (this._label.textColor);
        }
        public function set textColor(_arg1:uint):void{
            this._label.textColor = _arg1;
        }
        public function get textAlpha():Number{
            return (this._label.textAlpha);
        }
        public function set textAlpha(_arg1:Number):void{
            this._label.textAlpha = _arg1;
        }
        public function set textFilter(_arg1:Array):void{
            this._label.textFilter = _arg1;
        }
        public function get textFilter():Array{
            return (this._label.textFilter);
        }
        public function get textField():TextField{
            return (this._label.textField);
        }

    }
}//package com.fminutes.vinciUI.controls 
